/*******************************************************************************
*  file    : testdataplugin.hpp
*  created : 07.07.2012
*  author  : Slyshyk Oleksiy (alex312@meta.ua)
*******************************************************************************/

#ifndef TESTDATAPLUGIN_HPP
#define TESTDATAPLUGIN_HPP

#include <QObject>
#include <QSharedPointer>
#include <interfaces.hpp>

class CWave;

class WaveDataPlugin : public QObject, public ReadFileFormatInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "tmx.com.ua.dsp.lab.ReadFileFormatInterface" FILE "wave_plugin.json")
    Q_INTERFACES(ReadFileFormatInterface)
public:
    QString name() const ;
    QStringList formats() const;
    QString fileFilter() const;
    void setName(const QString&);
    double  sampleRate() const ;
    QVector<std::complex<double> > getData();
    bool read();
    bool read(const QString&);
    void flush();
private:
    QString fileName_;
    QSharedPointer<CWave> wave_;
};

#endif // TESTDATAPLUGIN_HPP
